package cn.itsource.pethome.system.mapper;

import cn.itsource.pethome.system.domain.Menu;
import cn.itsource.pethome.system.domain.Role;
import cn.itsource.pethome.base.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zcj
 * @since 2022-10-19
 */
public interface RoleMapper extends BaseMapper<Role> {

    void insertRoleAndMenu(@Param("roleId") Long roleId,@Param("menus") List<Long> menus);

    void insertRoleAndPermission(@Param("roleId")Long roleId, @Param("permissions")List<Long> permissions);

    Role querySn(String sn);

    List<Menu> queryMenuByRoleId(Long roleid);

    List<Long> queryPermissionByRoleId(Long roleid);

    void deleteRoleAndMenu(Long id);

    void deleteRoleAndPermission(Long id);
}
